#include "ObservableGtk.h"
#include "ObserverGtk.h"

ObservableGtk::ObservableGtk()
{
}

void ObservableGtk::addObserver(ObserverGtk* observer) {
	observer->setObservable(this);
	this->observers.push_back(observer);
}

void ObservableGtk::deleteObserver(ObserverGtk* observer) {
	this->observers.remove(observer);
}

void ObservableGtk::notifyObservers() {
	for (list<ObserverGtk*>::iterator it = observers.begin(); it != observers.end(); it++)
		if(*it){
			(*it)->getDispatcher().emit();
		}
	}

ObservableGtk::~ObservableGtk()
{
}
